package com.lb.mytest;

import com.google.common.collect.Lists;

import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;

/**
 * @Author: zhangjun
 * @Date: 2020/5/18 21:12
 * @Description:
 */
public class Demo {
    public static void main(String[] args) {
        Long l1 = 10l;
        System.out.println(Objects.equals(l1,10));

        List<String> list = Lists.newLinkedList();
        list.add("3.5");
        list.add("1.5");
        list.add("3");
        list.add("3.9");
        System.out.println(">>>>>>>>>>>>>>>>>>");
        list.forEach(System.out::println);

        list.sort((o1, o2) -> {
            if (Double.valueOf(o1) > Double.valueOf(o2)) {
                return 1;
            } else if (Double.valueOf(o1) < Double.valueOf(o2)) {
                return -1;
            } else {
                return 0;
            }
        });

        System.out.println(">>>>>>>>>>>>>>>>>>");
        list.forEach(System.out::println);


        Long a = new Long(100);
        Long b = new Long(100);
        System.out.println(a.equals(b));

        double amount = 123.12900;
        BigDecimal bigDecimal = BigDecimal.valueOf(amount).setScale(2, BigDecimal.ROUND_HALF_UP);
        System.out.println(bigDecimal);
    }
}
